/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: Dec 31, 2009
 * Time: 11:06:15 AM
 * To change this template use File | Settings | File Templates.
 */
import org.jdom.Element;

// Referenced classes of package dk.brics.dsd:
//            Boolexp, Schema, Context

class NotBoolexp extends Boolexp
{

    NotBoolexp(Element element, Schema schema)
    {
        exp = parseOne(element, schema);
    }

    byte evaluate(Context context)
    {
        byte byte0 = exp.evaluate(context);
        if(byte0 == 1)
            return 2;
        if(byte0 == 2)
            return 1;
        else
            return byte0;
    }

    boolean isMentioned(Context context)
    {
        return exp.isMentioned(context);
    }

    Element toXML(Context context)
    {
        return (new Element("not", "http://www.brics.dk/DSD/2.0")).addContent(exp.toXML(context));
    }

    boolean containsThis(Context context)
    {
        return exp.containsThis(context);
    }

    Boolexp exp;
}
